package org.groupg.practice.guiPractice.progressDemo;

/**
 * 2. 进度条的更新逻辑封装在一个事件监听器中，并将该监听器注册到事件总线上。
 */
public class ProgressListener implements EventListener {
    private ProgressBarDemo progressBarDemo;

    public ProgressListener(ProgressBarDemo progressBarDemo) {
        this.progressBarDemo = progressBarDemo;
    }

    @Override
    public void onEvent(ProgressEvent event) {
        progressBarDemo.updateProgress(event.getProgress());
    }
}